﻿@using DevExpress.Blazor.Internal
@using DevExpress.ExpressApp.Blazor;
@using DevExpress.ExpressApp.Blazor.Templates

@inherits FrameTemplateComponentBase<MdiViewWindowTemplate>

@{
    var toolbarVisible = FrameTemplate.IsActionsToolbarVisible && @FrameTemplate.Toolbar.ContainsVisibleActionControl();
}
@if (toolbarVisible)
{
    var secondToolbarVisible = FrameTemplate.SecondToolbar.ContainsVisibleActionControl();
    <div class="main-toolbar @(secondToolbarVisible ? "pt-3 pb-1" : "py-3") px-2 px-sm-3">@FrameTemplate.Toolbar.GetComponentContent()</div>
    @if (secondToolbarVisible)
    {
        <div class="main-toolbar pb-3 px-2 px-sm-3">@FrameTemplate.SecondToolbar.GetComponentContent()</div>
    }
}
<div class="main-content d-flex xaf-flex-auto @(toolbarVisible ? "pb-3" : "py-3")" style="height:0">
    <DxScrollViewer CssClass="xaf-flex-auto px-2 px-sm-3">
        <ViewSiteComponent View="@FrameTemplate.View" />
    </DxScrollViewer>
</div>

@code {
    public static RenderFragment Create(MdiViewWindowTemplate windowTemplate)
    {
        return @<MdiViewWindowTemplateComponent FrameTemplate="@windowTemplate" />;
    }
}
